package com.ckc.auth.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.security.RolesAllowed;

@RestController
@RequestMapping("/admin")
public class AdminController {


    @PreAuthorize("hasRole('ROLE_ADMIN')")
    @RequestMapping("/demo")
    public String demo(){
        return "安全提示";
    }

}
